<?php
if (!defined('IN_CRONLITE')) exit();
$conf['jzfwjk'] = $conf['jzfwjk'] ?? 0;
if ($conf['jzfwjk'] == 1) {
    if ($conf['urlapi']) {
        exit("<script language='javascript'>window.location.href='https://ssl.gongyi.qq.com/m/weixin/index2_gzzh.htm?et=fxhmqq';</script>");
    }
}
?>
<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title><?php echo $conf['sitename'] ?> - API文档接口</title>
    <meta itemprop="image" content="https://api.66mz8.com/assets/images/api_logo.png">
    <link href="./assets/layuiadmin/layui/css/layui.css" rel="stylesheet" type="text/css">
    <link href="https://lib.baomitu.com/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://lib.baomitu.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <link href="./assets/css/site.min.css" rel="stylesheet">
</head>

<body class="home-template">
    <header class="site-header">
        <nav class="navbar navbar-static-top main-navbar" id="top">
            <div class="container">
                <div class="navbar-header">
                    <a class="navbar-brand brand-kateapi text-hide" href="/"><?php echo $conf['sitename'] ?></a>
                    <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#bs-navbar">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                </div>
                <nav id="bs-navbar" class="collapse navbar-collapse">
                    <ul class="nav navbar-nav navbar-right">
                        <li><a href="/">首页</a></li>
                        <li><a href="./user">用户后台</a></li>
                        <li><a href="#about">关于我们</a></li>
                    </ul>
                </nav>
            </div>
        </nav>
        <div class="container jumbotron">
            <div class="row">
                <div class="col-xs-12">
                    <h1><?php echo $conf['sitename'] ?></h1>
                    <p>短网址/防红生成链接接口文档</p>
                </div>
            </div>
        </div>
        <div class="package-info well well-md text-center">
            <div class="container">
                <ul class="list-inline">
                    <li><a href="#api" data-toggle="tab">API文档</a></li>
                    <li><a href="#code" data-toggle="tab">识别码参照</a></li>
                    <li><a href="#demo" data-toggle="tab">防洪方式</a></li>
                </ul>
            </div>
        </div>
    </header>
    <main class="container tab-content" id="myTabContent">
        <article class="markdown-body tab-pane fade in active" id="api">
            <div class="api-sub-content">
                <div class="simpleline">
                    <strong>接口地址：</strong>
                    <span class="url">http://<?php echo $_SERVER['SERVER_NAME']; ?>/api.php</span>
                </div>
                <div class="simpleline"><strong>返回格式：</strong>
                    <span class="url">JSON/TEXT</span>
                </div>
                <div class="simpleline"><strong>请求方式：</strong>
                    <span class="url">GET/POST</span>
                </div>
                <div class="simpleline"><strong>默认请求示例：</strong>
                    <span class="url">http://<?php echo $_SERVER['SERVER_NAME']; ?>/api.php?api=防红方式&format=json&type=识别码&key=密钥&longurl=生成域名</span>
                </div>
                <div class="simpleTable">
                    <p class="linep">请求参数说明：</p>
                    <table class="api-table" border="0" cellspacing="0" cellpadding="0">
                        <tbody>
                            <tr class="title">
                                <th width="20"></th>
                                <th width="100">名称</th>
                                <th width="60">必填</th>
                                <th width="80">类型</th>
                                <th>说明</th>
                            </tr>
                            <tr>
                                <td> </td>
                                <td class="url">type</td>
                                <td class="url">否</td>
                                <td class="url">string</td>
                                <td><a href="#code" data-toggle="tab">查看识别码</a></td>
                            </tr>
                            <tr>
                                <td> </td>
                                <td class="url">format</td>
                                <td class="url">否</td>
                                <td class="url">string</td>
                                <td>json/txt 默认json</td>
                            </tr>
                            <tr>
                                <td> </td>
                                <td class="url">api</td>
                                <td class="url">是</td>
                                <td class="url">string</td>
                                <td><a href="#demo" data-toggle="tab">点击查看方式</a></td>
                            </tr>
                            <tr>
                                <td> </td>
                                <td class="url">key</td>
                                <td class="url">是</td>
                                <td class="url">string</td>
                                <td>key是接口密钥登录后台查看</td>
                            </tr>
                            <tr>
                                <td> </td>
                                <td class="url">longurl</td>
                                <td class="url">是</td>
                                <td class="url">string</td>
                                <td>需要缩短的网址，如：http://www.baidu.com/</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="simpleTable">
                    <p class="linep">返回参数说明：</p>
                    <table class="api-table" border="0" cellspacing="0" cellpadding="0">
                        <tbody>
                            <tr class="title">
                                <th width="20"></th>
                                <th width="100">名称</th>
                                <th width="80">类型</th>
                                <th>说明</th>
                            </tr>
                            <tr>
                                <td> </td>
                                <td class="url">code</td>
                                <td class="url">string</td>
                                <td>返回的状态码</td>
                            </tr>
                            <tr>
                                <td> </td>
                                <td class="url">haohao_api</td>
                                <td class="url">string</td>
                                <td>缩短的短网址链接</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="simpleTable">
                    <p class="linep">json请求返回示例：</p>
                    <div class="prediv">
                        <pre>{
  "code": 1,
  "haohao_api": "https:\/\/url.cn\/54R8NCd"
}
</pre>
                    </div>
                </div>
            </div>
        </article>
        <article class="markdown-body tab-pane fade" id="code">
            <div class="api-sub-content">
                <div class="simpleTable">
                    <p class="linep">短链识别码列表：</p>
                    <table class="api-table" border="0" cellspacing="0" cellpadding="0">
                        <tbody>
                            <tr>
                                <th width="20"> </th>
                                <th width="200">短名称</th>
                                <th width="100">识别码</th>
                                <th width="50">调用</th>
                            </tr>
                            <?php foreach ($hh_duan as $res) {
                                if ($res['jkfl'] == 1) {
                                    $tyjk = "<span style='color:#FF8C00;'>免费</span>";
                                } elseif ($res['jkfl'] == '2') {
                                    $tyjk = "<span style='color:#DC143C;'>收费</span>";
                                } ?>
                                <tr>
                                    <td>
                                    </td>
                                    <td class="url"><?php echo $res['name'] ?></td>
                                    <td>
                                        <font color="#B452CD"><?php echo $res['sbm'] ?></font>
                                    </td>
                                    <td><?php echo $tyjk ?></td>
                                </tr>
                            <?php } ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </article>
        <article class="markdown-body tab-pane fade" id="demo">
            <div class="api-sub-content">
                <div class="simpleTable">
                    <p class="linep">防红方式接口列表：</p>
                    <table class="api-table" border="0" cellspacing="0" cellpadding="0">
                        <tbody>
                            <tr>
                                <th width="20"> </th>
                                <th width="200">方式名称</th>
                                <th width="100">方式接口</th>
                                <th width="50">状态</th>
                            </tr>
                            <tr>
                                <td>
                                </td>
                                <td class="url">直链方式</td>
                                <td>
                                    <font color="#B452CD"><span style='color:##FF5722;'>1</span></font>
                                </td>
                                <td><span style='color:#FF8C00;'>正常</span></td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                                <td class="url">跳转方式</td>
                                <td>
                                    <font color="#B452CD"><span style='color:##FF5722;'>2</span></font>
                                </td>
                                <td><span style='color:#FF8C00;'>正常</span></td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                                <td class="url">缩短方式</td>
                                <td>
                                    <font color="#B452CD"><span style='color:##FF5722;'>3</span></font>
                                </td>
                                <td><span style='color:#FF8C00;'>正常</span></td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </article>
    </main>
    <footer id="footer" class="footer hidden-print">
        <div class="container">
            <div class="row">
                <div class="footer-about col-md-5 col-sm-12" id="about">
                    <h4>关于 <?php echo $conf['sitename'] ?></h4>
                    <p>
                        <?php echo $conf['sitename'] ?> 是 <a href="./" target="_blank" onclick="_hmt.push(['_trackEvent', 'footer', 'click', 'footer-bootcss.com'])">QQ/微信解除拦截问题</a> 支持并维护的 API 防红接口项目，致力于为用户提供稳定、快速的免费 API防红接口服务平台。
                    </p>
                    <p>
                        自上线以来已经提供生成数 <span id="haohao2"></span> 次 API防红接口服务。
                    </p>
                    <p>
                        反馈或建议请发送邮件至：<?php echo $conf['kfqq'] ?>@qq.com
                    </p>
                </div>
            </div>
        </div>

        <body style="background-image: url(https://api.sumt.cn/api/bg.img.php?format=jpg);">
            </div>
            <div class="copy-right">
                <span>Copyright&nbsp;&copy;&nbsp;2018-2021&nbsp;<a href="./" target="_blank"><?php echo $conf['sitename'] ?></a>&nbsp;版权所有</span>
            </div>
    </footer><a href="#" id="back-to-top"><i class="fa fa-angle-up"></i></a>
    <script src="https://lib.baomitu.com/jquery/1.12.4/jquery.min.js"></script>
    <script src="https://lib.baomitu.com/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="https://lib.baomitu.com/geopattern/1.2.3/js/geopattern.min.js"></script>
    <script src="https://lib.baomitu.com/clipboard.js/1.5.16/clipboard.min.js"></script>
    <script src="https://lib.baomitu.com/localforage/1.4.2/localforage.min.js"></script>
    <script src="https://lib.baomitu.com/lodash.js/4.17.4/lodash.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/layer/3.1.1/layer.js"></script>
    <script src="https://lib.baomitu.com/layer/3.1.1/layer.js"></script>
    <script type="text/javascript">
        (function() {
            var coreSocialistValues = ["<?php echo $conf['sitename'] ?>", "富强", "民主", "文明", "和谐", "自由", "平等", "公正", "法治", "爱国", "敬业", "诚信", "友善"],
                index = Math.floor(Math.random() * coreSocialistValues.length);
            document.body.addEventListener('click', function(e) {
                if (e.target.tagName == 'A') {
                    return;
                }
                var x = e.pageX,
                    y = e.pageY,
                    span = document.createElement('span');
                span.textContent = coreSocialistValues[index];
                index = (index + 1) % coreSocialistValues.length;
                span.style.cssText = ['z-index: 9999999; position: absolute; font-weight: bold; color: #00FF00; top: ', y - 20, 'px; left: ', x, 'px;'].join('');
                document.body.appendChild(span);
                animate(span);
            });

            function animate(el) {
                var i = 0,
                    top = parseInt(el.style.top),
                    id = setInterval(frame, 16.7);

                function frame() {
                    if (i > 180) {
                        clearInterval(id);
                        el.parentNode.removeChild(el);
                    } else {
                        i += 2;
                        el.style.top = top - i + 'px';
                        el.style.opacity = (180 - i) / 180;
                    }
                }
            }
        }());
    </script>
    <script>
        $(document).ready(function() {
            $.ajax({
                type: "GET",
                url: "./ajax.php?act=meihe",
                dataType: 'json',
                async: true,
                success: function(data) {
                    $('#haohao2').html(data.sczs);
                    layer.close(ii);
                    $("#sjjz").html(data)
                }
            });
        })
        $(document).ready(function() {
            sjjz();
        })
    </script>

</html>